<template>
  <!-- 右侧导航 -->
  <div class="home">
    <el-container class="layout-container-demo" style="height: 100%">
    <el-aside width="200px">
      <el-scrollbar>
        <el-menu router :default-openeds="['1', '4']"
        class="el-menu-vertical-demo"
        active-text-color="#ffd04b"
        background-color="#545c64"
        default-active="2"
        text-color="#fff">          
        <el-sub-menu index="1">
            <template #title>
              <!-- 图标 -->
              <el-icon><HomeFilled /></el-icon>系统介绍
            </template>
            <el-menu-item-group>
              <el-menu-item index="/dashboard">Dashboard</el-menu-item>
              <el-menu-item index="/addshop">添加商品</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="2">
            <template #title>
              <el-icon><Setting /></el-icon>首页配置
            </template>
            <el-menu-item-group>
              <el-menu-item index="/configure/lunbo">轮播图配置</el-menu-item>
              <el-menu-item index="/configure/rootshop">热销商品配置</el-menu-item>
              <el-menu-item index="/configure/xinpin">新品上线配置</el-menu-item>
              <el-menu-item index="/configure/tuijian">为你推荐配置</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="3">
            <template #title>
              <el-icon><Tools /></el-icon>模块管理
            </template>
            <el-menu-item-group>
              <el-menu-item index="/modular/classification">分类管理</el-menu-item>
              <el-menu-item index="/modular/shopguan">商品管理</el-menu-item>
              <el-menu-item index="/modular/hotguan">会员管理</el-menu-item>
              <el-menu-item index="/modular/dingdan">订单管理</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
          <el-sub-menu index="4">
            <template #title>
              <el-icon><MessageBox /></el-icon>系统管理
            </template>
            <el-menu-item-group>
              <el-menu-item index="/user/message">个人信息</el-menu-item>
              <el-menu-item index="/user/fixmessage">修改密码</el-menu-item>
            </el-menu-item-group>
          </el-sub-menu>
        </el-menu>
      </el-scrollbar>
    </el-aside>
<!-- 顶部内容 -->
<el-container>
      <el-header style="text-align: right; font-size: 16px; color: rgb(255, 255, 255); ">
           <span class="lift">
            <el-icon><Operation /></el-icon>
        </span>
        <div class="toolbar">         
           <el-dropdown>
          <el-icon style="margin-right: 8px; margin-top: 1px; font-size:19px; color: rgb(255, 255, 255);"
              ><UserFilled
            /></el-icon>
            <template #dropdown>
              <el-dropdown-menu>
                <el-dropdown-item @click="out">退出</el-dropdown-item>
                <el-dropdown-item @click="information">个人信息</el-dropdown-item>
                <el-dropdown-item @click="fix">修改密码</el-dropdown-item>
              </el-dropdown-menu>
            </template>
          </el-dropdown>
          <span>admin</span>
        </div>
      </el-header>
      <!-- 类容 -->
        <el-main>
          <el-scrollbar>
            <!-- 嵌套内容 -->
            <router-view />
          </el-scrollbar>
        </el-main>
    </el-container>
  </el-container>
  </div>
</template>

<script>
export default {
  methods: {
    out() {
      this.$router.push('/')       
    },
    information() {
      this.$router.push('/user/message')       
    },
    fix() {
      this.$router.push('/user/fixmessage')       
    },

  }
}

</script>

<style lang="less" scope>

.home {
  height: 100%;
}

.layout-container-demo .el-header {  
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  background-color: var(--el-color-primary-light-7);
  color: var(--el-text-color-primary);
  background-color: black;
}
.layout-container-demo .el-aside {
  color: var(--el-text-color-primary);
  background: var(--el-color-primary-light-8);
}
.layout-container-demo .el-menu {
  border-right: none;
}
.layout-container-demo .el-main {
  height: 100%;
  padding: 0;
}
.el-menu-vertical-demo{
  height: 100vh;
  overflow: hidden;
  overflow-y: auto;
}
</style>
